package com.wxzl.community.common

import org.junit.Test
import java.io.File

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * @see [Testing documentation](http://d.android.com/tools/testing)
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {



//        include ':module_linphone'
//        include ':module_wj_service'
//        include ':module_wj_user'
//        include ':app'
//        include ':module_wj_main'
//        include ':lib_wj_common'
//        include ':module_wj_travel'
//        include ':lib_wj_keyboard'
//        include ':module_wj_property'
        var file = File("E:\\project\\FiveStarsCommunity\\module_wj_property\\src\\main\\res\\layout")
        file.listFiles().forEach {


            var line = it.readText()
            val r = "android:textColor=\"#([0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3})\"".toRegex()
            var ms  =  r.findAll(line)
            var map = HashMap<String, String>()
            ms.forEach {
                map.put(it.value,"")

            }


            map.forEach {
                println(it.key)

                line = line.replace(it.key,"")

            }

            println(line)
            it.writeText(line)

        }



    }

    @Test
    fun addition_isCorrect2() {

        val r = "android:textColor=\"#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})\"".toRegex()

        var string ="aaaandroid:textColor=\"#1677FF\""
        var ms  =  r.findAll(string)

        var map = HashMap<String, String>()
        ms.forEach {
            map.put(it.value,"")

        }


        map.forEach {


            string = string.replace(it.key,"")

        }

            println(string)
//            it.writeText(line)

//        include ':module_linphone'
//        include ':module_wj_service'
//        include ':module_wj_user'
//        include ':app'
//        include ':module_wj_main'
//        include ':lib_wj_common'
//        include ':module_wj_travel'
//        include ':lib_wj_keyboard'
//        include ':module_wj_property'

//            it.writeText(line)

        }





}